﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microhard.Core.DBUtility;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;
using Microhard.WarehouseInsp.Buz.Validator;
using Microhard.WarehouseInsp.Buz.BuzEnum;
using Microhard.Core.Extensions;

namespace Microhard.WarehouseInsp.Buz.Models
{
    [FluentValidation.Attributes.Validator(typeof(PledgePlanInRecordValidator))]
    public class PledgePlanInRecordsModel : BasePermissionModel
    {
        [ModelPKID]
        public Guid PlnPdgID { set; get; }
        [UIHint("ProductListSelect")]
        public string ProductIDForSelect { set; get; }
        [UIHint("WarehouseSelect")]
        public string WarehouseIDForSelect { set; get; }
        [ScaffoldColumn(false)]
        public Guid ProjectID { set; get; }
        public Guid WarehouseID { set; get; }
        public Guid ProductID { set; get; }
        public ProductListModel Product { set; get; }
        [DataType("Number")]
        public double PlanCount { set; get; }
        [DataType(DataType.Currency)]
        public decimal PlanAmount { set; get; }
        public DateTime CreateTime { set; get; }
        [DataType(DataType.Currency)]
        public decimal PlanPrice { set; get; }
        public int Status { set; get; }
        public string StatusDisplay
        {
            get
            {
                var um = (PrjStatus)Enum.Parse(typeof(PrjStatus), this.Status.ToString());
                return um.GetDisplayText();
            }
        }

        public WarehouseModel Warehouse { set; get; }
        public string QueryForProductName { set; get; }
        [UIHint("CategorySelect")]
        public string PlgCategory { set; get; }
        public SupProjectModel Project { get; set; }
        public string QueryForPrjCode { set; get; }
    }
}
